﻿@page "/basic/author/list"

@using HentaiBlazor.Data.Basic

<PageContainer Title="作品作者">

    <Space Style="margin-bottom: 0.5rem">
        <SpaceItem>
            <Input Prefix="@_filter" Placeholder="关键字" Style="width: 12rem;"
                   @bind-Value="searchKeyword" />
            <Select @bind-Value="@searchMode" Style="width: 8rem;" TItemValue="string" TItem="string">
                <SelectOptions>
                    <SelectOption TItemValue="string" TItem="string" Value="@("ALL")" Label="全部数据" />
                    <SelectOption TItemValue="string" TItem="string" Value="@("MASTER")" Label="主数据" />
                </SelectOptions>
            </Select>
        </SpaceItem>
        <SpaceItem>
            <Button Type="@ButtonType.Primary" OnClick="()=>Search()">查询</Button>
        </SpaceItem>
    </Space>

    <Table TItem="BAuthorEntity" DataSource="@BAuthorEntities" Size=@TableSize.Small>
        <ActionColumn Width="160">
            <Space>
                <SpaceItem>
                    <Button Type="@ButtonType.Primary" Danger OnClick="() => OpenRemove(context.Id)">删除</Button>
                    <Button Type="@ButtonType.Primary" OnClick="() => OpenEdit(context.Id)">修改</Button>
                </SpaceItem>
            </Space>
        </ActionColumn>
        <Column Title="名称" @bind-Field="@context.Name">
            <a href="@("/comic/author/" + context.Id)" target="_blank">
                @context.Name
            </a>
        </Column>
        <Column Title="映射" @bind-Field="@context.Alias"></Column>
        <Column Title="合法" @bind-Field="@context.Valid"></Column>
        <Column Title="项目数量" @bind-Field="@context.Items"></Column>
        <Column Title="备注" @bind-Field="@context.Note"></Column>
    </Table>
</PageContainer>

@code
{
    RenderFragment _filter =@<Icon Type="filter" />;
}

